<?php
defined('IN_MAIN') or exit('Invalid Access!');

//#####files
$file["admin"]["member_list"]="member_list.php";
$file["admin"]["add_edit_member"]="member_ae.php";
$file["admin"]["sales_list"]="sales_list.php";
$file["admin"]["add_edit_sales"]="sales_ae.php";

$file['member']['index']='index.php';
$file['member']['profile']='profile.php';
$file['member']['activate']='activate.php';
$file['member']['purchase']='purchase.php';
$file["member"]["genealogy"]="genealogy.php";
$file['member']['network']='matrix.php';
$file['member']['placement']='placement.php';
$file['member']['ewallet_transfer']='e_transfer.php';
$file['member']['commission']='commission.php';
$file['member']['withdrawal']='withdrawal.php';
$file['member']['purchase_history']='history_purchase.php';
$file['member']['withdrawal_history']='history_withdrawal.php';
$file['member']['ewallet_history']='history_ewallet.php';
$file['member']['support']='messaging.php';
$file['member']['compensation']='compensation.php';
$file['member']['logout']='logout.php';

$file["public"]["index"]="index.php";
$file["public"]["company"]="company.php";
$file["public"]["overview"]="overview.php";
$file["public"]["mission"]="mission.php";
$file["public"]["director"]="director.php";
$file["public"]["managementteam"]="managementteam.php";
$file["public"]["products"]="products.php";
$file["public"]["products_health"]="products_health.php";
$file["public"]["products_3dtv"]="products_3dtv.php";
$file["public"]["products_waterfilter"]="products_waterfilter.php";
$file["public"]["products_beautybar"]="products_beautybar.php";
$file["public"]["events"]="events.php";
$file["public"]["news"]="news.php";
$file["public"]["news_short"]="news_short.php";
$file["public"]["opportunity"]="opportunity.php";
$file["public"]["faq"]="faq.php";
$file["public"]["coo"]="coo.php";
$file["public"]["compensation"]="compensation.php";
$file["public"]["register"]="register.php";
$file["public"]["login"]="login.php";
$file["public"]["forgot_password"]="forgot_password.php";
$file["public"]["terms"]="terms.php";
$file["public"]["sitemap"]="sitemap.php";
$file["public"]["contact"]="contact.php";
$vars["file"]=$file;

//css styles

$_css["msg_style"]="style='font-family:verdana; font-size:11px;'";
$_css["table_style"]="style='border-collapse:collapse;font-family:verdana;font-size:11px;'";
$_css["td_style"]="style='border:1px solid black; padding: 3px;'";
$_css["td_title_style"]="style='height:30px; padding: 3px; font-weight:bold;'";
$_css["td_right_style"]="style='border:1px solid black; padding: 3px; text-align:right;'";
$_css["td_center_style"]="style='border:1px solid black; padding: 3px; text-align:center;'";
$_css["th_style"]="style='border:1px solid black; background: #888; padding: 3px; font-weight:bold;'";
$_css["th_right_style"]="style='border:1px solid black; background: #888; padding: 3px; font-weight:bold; text-align:right;'";

$vars["css"]=$_css;

//products
$_product['p1']['price']=1000;//[product code 1] = rm1000
$_product['p1']['bv']=400;
$_product['p1']['title']="Package 1";
$_product['p2']['price']=3000;
$_product['p2']['bv']=1200;
$_product['p2']['title']="Package 2";
$_product['p3']['price']=7000;
$_product['p3']['bv']=2800;
$_product['p3']['title']="Package 3";
$_product['p4']['price']=15000;
$_product['p4']['bv']=6000;
$_product['p4']['title']="Package 4";
foreach($_product as $_refno => $_detail){
	$_r_product[] = $_refno;
	$_r_product_d[$_refno] = $_detail['title']." ".$vars['currency'].number_format($_detail['price'], 2)." (".number_format($_detail['bv'], 2)."BV)";
}

//packages
$_package[1]['p1']['price']=5000;//[number of BC][product code][price] = rm5000
$_package[1]['p1']['bv']=4000;
$_package[1]['p1']['title']="1BC Package 1";
$_package[1]['p2']['price']=8000;
$_package[1]['p2']['bv']=6500;
$_package[1]['p2']['title']="1BC Package 2";
$_package[3]['p3']['price']=10000;
$_package[3]['p3']['bv']=8000;
$_package[3]['p3']['title']="3BC Package 1";
$_package[3]['p4']['price']=12000;
$_package[3]['p4']['bv']=10000;
$_package[3]['p4']['title']="3BC Package 2";
$_package[7]['p5']['price']=22000;
$_package[7]['p5']['bv']=20000;
$_package[7]['p5']['title']="7BC Package 1";
$_package[7]['p6']['price']=25000;
$_package[7]['p6']['bv']=22000;00;
$_package[7]['p6']['title']="7BC Package 2";
$_package[15]['p7']['price']=45000;
$_package[15]['p7']['bv']=40000;
$_package[15]['p7']['title']="15BC Package 1";
$_package[15]['p8']['price']=50000;
$_package[15]['p8']['bv']=46000;
$_package[15]['p8']['title']="15BC Package 2";
foreach($_package as $_bc => $_detail){
	foreach($_detail as $pcode => $_pdetail){
		$_r_package[$_bc][] = $pcode;
		$_r_package_d[$pcode] = $_pdetail['title']." ".$vars['currency'].number_format($_pdetail['price'], 2)." (".number_format($_pdetail['bv'], 2)."BV)";
	}
}

$vars['product']=$_product;
$vars['r_product']=$_r_product;
$vars['r_product_detail']=$_r_product_d;
$vars['package']=$_package;
$vars['r_package']=$_r_package;
$vars['r_package_detail']=$_r_package_d;

//commissions
$_matrix_wide=5;

$_product_ref_comm=10;//percent

$_min_maintain = 200; //must have this personal sales volume to enjoy the commission
$_pairing_amount_per_pair = 5000;
$_pairing_bonus_per_pair = 10;
$_max_pair_per_day = 10;
$_matching_bonus[1]['percent'] = 10; //[level] = commission percentage
$_matching_bonus[1]['sponsor'] = 1; //[level] = how many downline the member need to have to qualify for this level of matching
$_matching_bonus[2]['percent'] = 10;
$_matching_bonus[2]['sponsor'] = 1;
$_matching_bonus[3]['percent'] = 10;
$_matching_bonus[3]['sponsor'] = 3;
$_matching_bonus[4]['percent'] = 10;
$_matching_bonus[4]['sponsor'] = 3;
$_matching_bonus[5]['percent'] = 10;
$_matching_bonus[5]['sponsor'] = 3;
$_matching_bonus[6]['percent'] = 10;
$_matching_bonus[6]['sponsor'] = 3;
$_matching_bonus[7]['percent'] = 10;
$_matching_bonus[7]['sponsor'] = 5;

$_pool[1]['volume'] = 200000;
$_pool[1]['min_leg'] = 2;
$_pool[1]['min_leg_volume'] = 50000;
$_pool[1]['percent'] = 1;
$_pool[2]['volume'] = 500000;
$_pool[2]['min_leg'] = 3;
$_pool[2]['min_leg_volume'] = 100000;
$_pool[2]['percent'] = 1;
$_pool[3]['volume'] = 1000000;
$_pool[3]['min_leg'] = 5;
$_pool[3]['min_leg_volume'] = 100000;
$_pool[3]['percent'] = 1;

$_unilevel[1]['percent'] = 10; //[level] = commission percentage
$_unilevel[1]['downline'] = 1; //[level] = how many downline the member need to have to qualify for this level of matching
$_unilevel[2]['percent'] = 10;
$_unilevel[2]['downline'] = 1;
$_unilevel[3]['percent'] = 10;
$_unilevel[3]['downline'] = 3;
$_unilevel[4]['percent'] = 10;
$_unilevel[4]['downline'] = 3;
$_unilevel[5]['percent'] = 10;
$_unilevel[5]['downline'] = 3;
$_unilevel[6]['percent'] = 10;
$_unilevel[6]['downline'] = 3;
$_unilevel[7]['percent'] = 10;
$_unilevel[7]['downline'] = 5;

$_stockist_comm_percent = 10;

$vars['matrix_wide']=$_matrix_wide;
$vars['product_ref_comm']=$_product_ref_comm;
$vars['min_maintain']=$_min_maintain;
$vars['pairing_amount_per_pair']=$_pairing_amount_per_pair;
$vars['pairing_bonus_per_pair']=$_pairing_bonus_per_pair;
$vars['max_pair_per_day']=$_max_pair_per_day;
$vars['matching_bonus']=$_matching_bonus;
$vars['pool']=$_pool;
$vars['unilevel']=$_unilevel;
$vars['stockist_comm_percent']=$_stockist_comm_percent;

//#####database names
$_prefix=$vars["dbi"]["prefix"];
$db->admin = $_prefix.'admin';
$db->users = $_prefix.'users';
$db->purchase = $_prefix.'purchase';
$db->purchase_detail = $_prefix.'purchase_detail';
$db->member_cf = $_prefix.'member_cf';
$db->member_comm = $_prefix.'member_comm';
$db->member_ewallet_record = $_prefix.'member_ewallet_record';
$db->member_ewallet_transfer = $_prefix.'member_ewallet_transfer';
$db->member_withdraw = $_prefix.'member_withdraw';
$db->pool_cf = $_prefix.'pool_cf';
$db->messaging = $_prefix.'messaging';
$db->cron = $_prefix.'cron';
$db->settings = $_prefix.'settings';
$db->ad_type = $_prefix.'ad_type';
$db->banner_ad = $_prefix.'banner_ad';
$db->banner_ad_stat = $_prefix.'banner_ad_stat';
$vars["db"]=$db;

//#####database paramaters & restrictions
/*
format:

datatype # - datatype can be 'str' for string or 'dec' for decimal
min length (str) / decimal value (dec) #
max length (str) /decimal point (dec) #
optional (o) / mandatory (m) #
field title in english #
min value for decimal type # - operator can be used >, >=, <, <=, and 'na', which means no min / max
max value for decimal type

e.g.
str#2#200#m#Title -> string type, 2 <= length <= 200, mandatory, with field title = title, english title = Title
dec#10#2#o#Number#0#100000 -> decimal type, with length (10,2), optional, with field title = number, english title = Number, min value is 0, max value is 100,000
*/

$dbr["admin"]["name"]="str#3#255#m#Name";
$dbr["admin"]["login"]="str#3#32#m#Login";
$dbr["admin"]["password"]="str#3#32#m#Password";
$dbr["admin"]["email"]="str#5#100#m#Email";

$dbr["users"]["id"]="dec#19#0#m#User ID#1#9223372036854775807";
$dbr["users"]["ref"]="dec#19#0#o#Sponsor ID#0#9223372036854775807";
$dbr["users"]["matrix_upline"]="dec#19#0#o#Upline ID#9223372036854775807";
$dbr["users"]["matrix_position"]="dec#10#0#o#Upline Position#1#4294967295";
$dbr["users"]["acc_type"]="str#0#1#o#Account Type";
$dbr["users"]["name"]="str#1#255#m#Name";
$dbr["users"]["username"]="str#3#32#m#Username";
$dbr["users"]["password"]="str#4#32#m#Password";
$dbr["users"]["email"]="str#5#100#m#Email";
$dbr["users"]["ic"]="str#1#12#m#I/C No.";
$dbr["users"]["gender"]="str#0#1#o#Gender";
$dbr["users"]["address"]="str#1#100#m#Address";
$dbr["users"]["address2"]="str#0#100#o#Address 2";
$dbr["users"]["city"]="str#1#100#m#City";
$dbr["users"]["zip"]="str#1#10#m#Zip / Postal Code";
$dbr["users"]["state"]="str#1#100#m#State / Province";
$dbr["users"]["country"]="str#1#3#m#Country";
$dbr["users"]["homeno"]="str#0#20#o#Home Phone";
$dbr["users"]["mobileno"]="str#1#20#m#Mobile Phone";
$dbr["users"]["officeno"]="str#0#20#o#Office Phone";
$dbr["users"]["faxno"]="str#0#20#o#Fax Phone";
$dbr["users"]["dob"]="str#0#20#o#Date of Birth";
$dbr["users"]["bank_name"]="str#0#100#o#Bank Name";
$dbr["users"]["bank_acc_no"]="str#0#30#o#Bank Acc/No.";
$dbr["users"]["bis_reg"]="str#1#20#m#Business Regisration No.";
$dbr["users"]["person_in_charge"]="str#1#100#m#Person in Charge";
$dbr["users"]["occupation"]="str#0#100#o#Occupation";
$dbr["users"]["remark"]="str#0#65536#o#Remark";
$dbr["users"]["cdate"]="str#0#19#o#Join Date";
$dbr["users"]["status"]="str#1#20#m#Status";

$dbr["purchase"]["qty"]="dec#5#0#m#Quantity#1#10000";
$dbr["purchase"]["remark"]="str#1#65536#o#Remark";

$dbr["member_ewallet_transfer"]["to_uid"]="dec#19#0#m#Transferee ID#1#9223372036854775807";
$dbr["member_ewallet_transfer"]["amount"]="dec#15#2#m#Transfer Amount#>0#na";
$dbr["member_ewallet_transfer"]["remark"]="str#0#65536#o#Remark";

$dbr["member_withdraw"]["uid"]="dec#19#0#m#User ID#1#9223372036854775807";
$dbr["member_withdraw"]["amount"]="dec#15#2#m#Withdrawal Amount#>0#na";
$dbr["member_withdraw"]["acc_name"]="str#1#100#m#Payee Account Name";
$dbr["member_withdraw"]["acc_no"]="str#1#30#m#Payee Account No.";
$dbr["member_withdraw"]["payment_date"]="str#0#19#o#Payment Date";
$dbr["member_withdraw"]["payment_remark"]="str#0#65536#o#Payment Reference";
$dbr["member_withdraw"]["remark"]="str#0#65536#o#Remark";

$dbr["messaging"]["subject"]="str#1#255#m#Subject";
$dbr["messaging"]["message"]="str#1#65536#m#Message";

$vars["dbr"]=$dbr;
?>